<template>
	<view class="container">
		<top-back-navbar position="fixed" title="钱包-提现" :background="pageColor"
			:color="fontColor"></top-back-navbar>
		<view class="big_title f-w-700">账户余额</view>
		<view class="header u-f-ajc u-f-column relative" :class="[(pageShowType == 2?'cz-box-gf':'')]" :style="{backgroundColor:pageColor}">
			<view class="f-w-700" style="font-size: 50rpx;margin-bottom: 10rpx;">￥{{credit}}</view>
			<view class="f-w-700">可用额度</view>
			<view class="absolute abso_box" @click="$u.route(`/pages/member/acommsion/projcommision/details?type=jb`)">提现记录</view>
		</view>

		<view class="radio_list">
			<view class="radio_item u-f-ac u-f-jsb" @click="value='yhk'">
				<view class="u-f-ac">
					<image src="/static/images/mine/yhk.jpg" mode="widthFix" class="item_image"></image>
					<view class="f-w-700">提现到银行卡</view>
				</view>
				<view>
					<radio value="yhk" :color="pageColor" :checked='value == "yhk"' /></radio>
				</view>
			</view>
		</view>


		<view class="footer">
			<button class="btn" :style="{backgroundColor:pageColor}" type="primary" @click="submit">立即提现</button>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageColor:'#001b4d',
				fontColor:'#ffffff',
				id: '',
				num: '',
				type: '',
				pageShowType: 1,
				value: 'yhk',
				delta: '',
				userInfo: {},
				requestQueyr:'',
				credit:'0.00'
			}
		},
		onLoad(e) {
			this.pageShowType = e.type ? e.type : 1;
			if(this.pageShowType==2){
				this.requestQueyr='&type=gf';//国风进入
				this.pageColor='#BA1B21';
				this.fontColor='#000000'
			}else if(this.pageShowType==3){
				this.requestQueyr='&type=fly_egg';//会飞的蛋进入
				this.pageColor='#224f91';
				this.fontColor='#ffffff'
			}
			this.getMember()
		},

		methods: {
			async getMember() {
				let {
					data
				} = await this.$myRequest({
					url: `/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=member&app=1${this.requestQueyr}`,
					data: {
						openid: uni.getStorageSync('openid')
					}
				})
				console.log(data)
				this.credit=this.lodash.isNumber(Number(data.credit2))?data.credit2:'0.00';
			},
			submit() {
				// if (this.value == 'yhk') return this.$u.route(`/pageA/member/acommsion/projcommision/application`)
				// if (this.value == 'yhk') return this.$u.route(`/pages/commission/tixian/tixian`)
				if (this.value == 'yhk') return this.$u.route(`/pages/member/details/tx/tx?type=${this.pageShowType}`)

			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f2f5fa;
		box-sizing: border-box;
	}

	.container {
		padding: 30rpx;
		height: 100%;
	}

	.big_title {
		font-size: 32rpx;
		color: #1e1310;
		font-weight: 600;
	}

	.header {
		background-color: #001b4d;
		width: 100%;
		height: 200rpx;
		box-sizing: border-box;
		border-radius: 20rpx;
		box-shadow: 0px 2px 8px 3px rgba(235,235,235,0.4);;
		margin: 20rpx 0 30rpx;
		color: #fff;
	}

	.cz-box-gf {
		background: transparent url(/static/images/home/gy_qb_bg.png) center no-repeat;
		background-size: 100% 100%;
	}

	.abso_box {
		right: 20rpx;
		top: 20rpx;
		border-radius: 10rpx;
		background-color: #9A94C1;
		padding: 5rpx 20rpx;
	}

	.radio_list {
		.radio_item {
			background-color: #FFFFFF;
			width: 100%;
			height: 110rpx;
			box-sizing: border-box;
			border-radius: 20rpx;
			box-shadow: 0px 2px 8px 3px rgba(235,235,235,0.4);;
			padding: 0 50rpx;

			image {
				width: 100rpx;
				margin-right: 20rpx;
			}

			view {
				font-size: 30rpx;
			}

			radio {
				transform: scale(0.8, 0.8);
			}
		}
	}

	.footer {
		position: fixed;
		bottom: 50rpx;
		left: 0;
		width: 100%;
		padding: 0 30rpx;
		box-sizing: border-box;
		z-index: 999;
	}

	.footer button {
		height: 90rpx;
		line-height: 90rpx;
		border-radius: 50rpx;
		background: #32539b;
	}

	.footer button.button-hover {
		background: #dc4d4d;
	}

	.btn-gf {
		background-color: #dc4d4d!important;
	}
</style>
